package com.autumn.platform.web.boot;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;

import com.autumn.platform.core.boot.CoreProperties;
import com.autumn.platform.web.resulthandler.wrapper.impl.PageProperties;

@ConfigurationProperties(prefix = WebProperties.PREFIX)
public class WebProperties {

    public static final String PREFIX = CoreProperties.AUTO_CONFIG_PROPERTIES_PREFIX + ".web";

    /**
     * 控制层AOP的扫描目标包
     */
    private String controllerAspectPackage;

    /**
     * 启用HTTPS时，将发向该端口的HTTP请求转发至HTTPS
     */
    private int httpPortToHttps;

    /**
     * 是否禁用自动更新UserAgent
     */
    private boolean disabledAutoUpdateUserAgent;

    /**
     * 分页配置
     */
    @NestedConfigurationProperty
    private PageProperties pageProperties;

    public String getControllerAspectPackage() {
        return controllerAspectPackage;
    }

    public void setControllerAspectPackage(String controllerAspectPackage) {
        this.controllerAspectPackage = controllerAspectPackage;
    }

    public int getHttpPortToHttps() {
        return httpPortToHttps;
    }

    public void setHttpPortToHttps(int httpPortToHttps) {
        this.httpPortToHttps = httpPortToHttps;
    }

    public boolean isDisabledAutoUpdateUserAgent() {
        return disabledAutoUpdateUserAgent;
    }

    public void setDisabledAutoUpdateUserAgent(boolean disabledAutoUpdateUserAgent) {
        this.disabledAutoUpdateUserAgent = disabledAutoUpdateUserAgent;
    }

    public PageProperties getPageProperties() {
        return pageProperties;
    }

    public void setPageProperties(PageProperties pageProperties) {
        this.pageProperties = pageProperties;
    }
}
